﻿using System;
using System.Collections.Generic;
using System.Linq;
using Salesman;

namespace Plan
{
    static class Program
    {
        static void Main(string[] args)
        {
            var alg = new SimulatedAnnealingAlgoritm
                          {
                              IterationCount = 1000000
                          };
            alg.ReportProgress += alg_ReportProgress;
            var generator = new Random(2);
            var instance = ScheduleInstance.GenerateRandom(generator, new ScheduleInstance.GenerateParams
                                                           {
                                                               GroupCount = 3,
                                                               RoomCount = 2,
                                                               SubjectCount = 10
                                                           });
            var solution = alg.Solve(instance);
            Console.WriteLine(solution.ToString());
            Console.WriteLine("Shittness: {0:0}", solution.PlanShitness());
            Console.ReadLine();
        }

        static void alg_ReportProgress(object sender, ReportProgressArgs e)
        {
            //Console.WriteLine("{0:0.00}, f={1:0.00000000}", e.Progress, e.BestSolution.PlanQuality());
            Console.WriteLine("{0}", e.LogMessage.Message);
        }
    }
}
